package com.example.administrator.express.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * Created by Administrator on 2016/9/16.
 */
@DatabaseTable(tableName = "role")
public class Role implements Parcelable {

    /**
     * roleId : 1
     * roleName : 经理
     */
    @DatabaseField(columnName = "roleId",generatedId = true)
    private int roleId;
    @DatabaseField(columnName = "roleName")
    private String roleName;

    public int getRoleId() {
        return roleId;
    }

    public void setRoleId(int roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.roleId);
        dest.writeString(this.roleName);
    }

    public Role() {
    }

    protected Role(Parcel in) {
        this.roleId = in.readInt();
        this.roleName = in.readString();
    }

    public static final Parcelable.Creator<Role> CREATOR = new Parcelable.Creator<Role>() {
        @Override
        public Role createFromParcel(Parcel source) {
            return new Role(source);
        }

        @Override
        public Role[] newArray(int size) {
            return new Role[size];
        }
    };
}
